import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router';
import { DataLine, House, Edit, Notebook } from '@element-plus/icons-vue';

export const baseRouter = [
  {
    path: '/',
    name: '首页',
    component: () => import('views/home'),
    children: [
      {
        path: '/home/dashboard',
        name: '学生概览',
        icon: DataLine,
        menu: true,
        component: () => import('views/dashboard/index.ts'),
      },
      {
        path: '/home/class',
        name: '班级管理',
        icon: 'class',
        menu: true,
        component: () => import('views/classManage'),
      },
      {
        path: '/home/teacher',
        name: '教师管理',
        icon: 'teacher',
        menu: true,
        component: () => import('views/teacherManage'),
      },
      {
        path: '/home/student',
        name: '学生管理',
        icon: 'student',
        menu: true,
        component: () => import('views/studentManage'),
      },
      {
        path: '/home/question',
        name: '题库管理',
        icon: 'positionBank',
        menu: true,
        component: () => import('views/questionBankManage'),
      },
      {
        path: '/home/homework',
        name: '作业管理',
        icon: 'homework',
        menu: true,
        component: () => import('views/homeworkManage'),
      },
      {
        path: '/home/myClass',
        name: '我的班级',
        icon: 'myClass',
        menu: true,
        component: () => import('views/myClassManage'),
      },
    ],
    code: '100',
  },
  {
    path: '/login',
    name: '登录',
    component: () => import('views/login/index.vue'),
    code: '101',
  },
];

export const sideMenu = baseRouter[0].children;
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: baseRouter,
});

export default router;
